<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 网站管理 <span class="c-gray en">&gt;</span> 分类导航<span class="c-gray en">&gt;</span> 添加分类导航</nav>
	<div id="sectionContent" class="Hui-article">
		<article class="page-container">
			<div class="form form-horizontal" id="form-admin-add">
				<input type="hidden" id="clasId" v-model="content.id"/>
        <input type="hidden" id="parent" v-model="content.parent"/>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>分类名称：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" id="claName" v-model="content.claName">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">分类图标：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" id="claIcon" v-model="content.claIcon">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>栏目排序：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" id="sorting" v-model="content.sorting">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">分类备注：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<textarea id="claNote" v-model="content.claNote" cols="" rows="" class="textarea" onKeyUp="textarealength(this,100)"></textarea>
						<p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
					</div>
				</div>
				<div class="row cl">
					<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
						<input class="btn btn-primary" type="button" v-on:click="saveData()" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" style="margin-right:30px;">
						<input class="btn" type="button" onclick="javascript:history.go(-1)" value="&nbsp;&nbsp;取消&nbsp;&nbsp;">
					</div>
				</div>
			</div>
		</article>
	</div>
	<script>
	      new Vue({
	          el:'#sectionContent',
	          http: authorization(),
	          data:{
	              content:{}
	          },
	          created:function(){
	              this.$http.get('/restful/cms/v1.0/clas/'+getQueryString('id')).then((response) => {
	                  this.content = responseObj(response).data;
	              }).catch(function(response) {
	                  alert(errorMsg(response));
	              });
	          },
	          methods:{
	              backToList:function(){
	                  window.parent.location.href="#!view/cms/clas/clas-list.html?"+Math.random();
	              },
	              saveData:function(){
	                  var formData = {
                      parent:$('#parent').val(),
                      claName:$('#claName').val(),
                      claNote:$('#claNote').val(),
                      claIcon:$('#claIcon').val(),
                      sorting:$('#sorting').val()
	                  };
	                  this.$http.put('/restful/cms/v1.0/clas/'+$('#clasId').val(),formData).then((response) => {
	                      this.backToList();
	                  }).catch(function(response) {
	                      alert(errorMsg(response));
	                  });
	              }
	          }
	      });
	  </script>
